using UnityEngine;
using UnityEngine.UI;

public class BuyVehicleController : MonoBehaviour
{
	public GarageController GarageController;

	public GameObject locked_gui;

	public GameObject buy_button;

	public Text vehicle_price;

	public void RefreshLocked(int i)
	{
		if (IsUnlocked(i))
		{
			locked_gui.SetActive(value: false);
			buy_button.SetActive(value: false);
		}
		else
		{
			locked_gui.SetActive(value: true);
			buy_button.SetActive(value: true);
		}
		vehicle_price.text = string.Empty + GarageController.prices[GarageController.active];
	}

	public bool IsUnlocked(int i)
	{
		if (PlayerPrefs.GetInt("vehicle_" + i + "_unlocked", 0) == 1)
		{
			return true;
		}
		return false;
	}

	public void BuyVehicle(int i)
	{
		PlayerPrefs.SetInt("vehicle_" + i + "_unlocked", 1);
	}
}
